package org.study.io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @description: io流图片复制
 * @author: Leo
 * @createDate: 2020/4/19
 * @version: 1.0
 */
public class CopyImage
{
    public static void main(String[] args) throws IOException
    {
        FileInputStream fileInputStream = new FileInputStream("E:\\图片\\timg.jpg");
        FileOutputStream fileOutputStream = new FileOutputStream("E:\\图片\\timg111.jpg");
        int len;
        byte[] bytes = new byte[1024];
        while ((len = fileInputStream.read(bytes)) != -1)
        {
            fileOutputStream.write(bytes, 0, len);
        }
        fileInputStream.close();
        fileOutputStream.close();
    }
}
